package com.controller;


import com.model.VideoBanner;
import com.service.VideoBannerService;
import com.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("api/v1/pub/video_banner")
@RestController
public class VideoBannerController {

    @Autowired
    private VideoBannerService videoBannerService;


    @GetMapping("list_banner")
    public JsonData getBanner(){
        List<VideoBanner> list=videoBannerService.listVideoBanner();
        return list==null?JsonData.buildError("获取轮播图数据失败"):JsonData.buildSuccess(list);
    }

}
